package com.meitianhui.convenitenbuy.main.di;

import android.app.Activity;

import com.meitianhui.convenitenbuy.di.PerActivity;
import com.meitianhui.convenitenbuy.main.presenter.LoginPresenter;
import com.meitianhui.convenitenbuy.main.presenter.MainPresenter;
import com.meitianhui.convenitenbuy.main.presenter.SplashPresenter;
import com.meitianhui.convenitenbuy.main.ui.LoginActivity;
import com.meitianhui.convenitenbuy.main.ui.MainActivity;
import com.meitianhui.convenitenbuy.main.ui.SplashActivity;

import dagger.Module;
import dagger.Provides;

@Module
public class MainModule {
    private SplashPresenter splashPresenter;
    private LoginPresenter loginPresenter;
    private MainPresenter mainPresenter;
    private Activity mActivity;

    public MainModule(Activity activity) {
        this.mActivity = activity;
    }

    @Provides
    @PerActivity
    public Activity provideActivity() {
        return mActivity;
    }


    public MainModule(SplashActivity activity) {
        splashPresenter = new SplashPresenter(activity, activity);
    }
    @Provides
    SplashPresenter provideSplash() {
        return splashPresenter;
    }
    public MainModule(LoginActivity activity) {
        loginPresenter = new LoginPresenter(activity, activity);
    }
    @Provides
    LoginPresenter provideLogin() {
        return loginPresenter;
    }
    public MainModule(MainActivity activity) {
        mainPresenter = new MainPresenter(activity, activity);
    }
    @Provides
    MainPresenter provideMain() {
        return mainPresenter;
    }

}
